Logic gates and Boolean algebra